package open.witype.filetiper.fragment;

import android.app.Activity;
import android.support.v4.app.Fragment;
import android.view.View;

import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;

import open.witype.filetiper.inter.OnBackPressListener;

/**
 * Created by Typer on 2015/5/22 0022.
 * Fragment的基类
 */
public class BaseFragment extends Fragment implements OnBackPressListener {

    public View root;

    @Override
    public void OnBackPressed() {
        getActivity().finish();
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        //((HomeActivity)activity).setListener(this);
    }

    public void show(String text) {
        Snackbar snackbar = Snackbar.with(getActivity()).text(text);
        SnackbarManager.show(snackbar);
    }
}
